package com.softeem.score.manager.mapper;

import com.softeem.score.model.dto.GradeComponentDto;
import com.softeem.score.model.dto.gradeDto.AdminScoreQueryDTO;
import com.softeem.score.model.dto.gradeDto.StudentScoreQueryDTO;
import com.softeem.score.model.entity.educational.Grade;
import com.softeem.score.model.vo.educational.GradeVo;
import com.softeem.score.model.vo.educational.StatisticVo;
import com.softeem.score.model.vo.educational.StudentScoreVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author zhu
 * @since 2024-02-14
 */
public interface GradeMapper {

    void doAssign(@Param("courseId") Long courseId, @Param("gradeComponentIdList") List<Long> gradeComponentId);

    List<Long> findGradeComponentsByCourseId(@Param("courseId") Long courseId);

    void deleteGradeComponentsWeightBycourseId(@Param("courseId") Long courseId);

    void updateGradeComponentWeight(@Param("courseId") Long courseId, @Param("gradeComponent") GradeComponentDto.GradeComponent gradeComponent);

    List<GradeVo> findByPage(AdminScoreQueryDTO adminScoreQueryDTO);

    List<StudentScoreVo> findByStudentNumber(StudentScoreQueryDTO studentScoreQueryDTO);

    void saveStudentToGradeByClassesId(Grade grade);

    void saveStudentToGradeDetail(@Param("gradeId") Long gradeId, @Param("gradeComponentCourseIds") List<Long> gradeComponentCourseIds);

    List<Long> findAllGradeIds(Long teachingClassId);

    void deleteAllByGradeIds(List<Long> allGradeIds);

    void deleteGradeDetail(List<Long> allGradeIds);

    List<Long> findGradeComponentCourseId(Long courseId);

    Integer findSizeByTeachingClassId(@Param("teachingClassIds") List<Long> teachingClassIds, @Param("studentNumber") String studentNumber);

    List<StatisticVo> findAllGradeByCourseId(Long courseId);

    void saveStudentToGrade(@Param("studentNumber") String studentNumber, @Param("teachingClassId") Long teachingClassId);

    void gradeDelete(@Param("teachingClassId") Long teachingClassId, @Param("courseId") String studentNumber);

    List<Long> findGradeIdByStudentNumberAndTeachingClassId(@Param("studentNumber") String studentNumber, @Param("teachingClassId") Long teachingClassId);
}
